#ifndef HTTP_LIVE_H
#define HTTP_LIVE_H

typedef struct HttpLiveS HttpLiveT;

struct HttpLiveOpsS
{
    int32_t (*start)(HttpLiveT * /* handler */);

    int32_t (*fill)(HttpLiveT * /* handler */, char * /*buf*/, int /*len*/);
    
    int32_t (*stop)(HttpLiveT * /* handler */);
    
};

struct HttpLiveS
{
    struct HttpLiveOpsS *ops;
};

#ifdef __cplusplus
extern "C"
{
#endif

HttpLiveT *HLCreate(uint16_t port, uint64_t size, char *path);

void HLDestroy(HttpLiveT *hl);

static inline int32_t HLStart(HttpLiveT *hl)
{
    return hl->ops->start(hl);
}

static inline int32_t HLFill(HttpLiveT *hl, char *buf, int len)
{
    return hl->ops->fill(hl, buf, len);
}

static inline int32_t HLStop(HttpLiveT *hl)
{
    return hl->ops->stop(hl);
}

#ifdef __cplusplus
}
#endif

#endif
